<template>
  <div>
    <van-nav-bar :title="title"
                 left-arrow
                 @click-left="onClickLeft()"
    />
    <slot></slot>
  </div>
</template>

<script>
import {NavBar} from "vant";

export default {
  name: "MyNavBar",
  components: {
    [NavBar.name]: NavBar
  },
  props: {
    title: {
      type: String,
      default: ""
    }
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    }
  }
}
</script>

<style scoped>

</style>